<div id="tracker-report-expert-query" class="tracker-report-query {{^ is_in_expert_mode }}tracker-report-query-undisplayed{{/ is_in_expert_mode }}" data-report-id="{{ id }}">
    <form action="" method="post" id="tracker-report-expert-query-form" class="tracker-report-query-form">
        <input type="hidden" name="report" value="{{ id }}" />
        <h4 class="backlog-planning-search-title {{ class_toggler }}" id="{{ id }}">{{ title }}</h4>
        <div class="pull-right">
            {{# is_normal_mode_button_displayed }}
                <button id="tracker-report-normal-query-button" type="button" class="btn btn-mini tracker-report-query-button">
                    <i class="icon-random"></i> {{ btn_report_normal_mode }}
                </button>
            {{/ is_normal_mode_button_displayed }}
        </div>
        <div class="tracker-report-expert-content">
            <div class="tracker-report-expert-content-query {{^ is_query_modifiable }}tracker-report-expert-content-query-readonly{{/ is_query_modifiable }}">
                <label for="tracker-report-expert-query-textarea">{{ query_label }}</label>
                <textarea id="tracker-report-expert-query-textarea"
                          name="expert_query"
                          placeholder="{{ query_placeholder }}"
                          data-allowed-fields="{{ allowed_fields_names_json_encoded }}"
                          {{^ is_query_modifiable }}readonly{{/ is_query_modifiable }}
                >{{ expert_query }}</textarea>
                <p class="help"><i class="icon-question-sign"></i> {{ query_tooltip }}</p>
            </div>
            <div class="tracker-report-expert-content-fields">
                <label for="allowed-fields">{{ allowed_fields_label }}</label>
                <select id="allowed-fields"
                        name="allowed-fields[]"
                        class="tracker-report-expert-allowed-fields"
                        multiple
                        {{^ is_query_modifiable }}readonly{{/ is_query_modifiable }}
                >
                    {{# allowed_fields }}
                        <option class="tracker-report-expert-allowed-field" value="{{ name }}">{{ label }}</option>
                    {{/ allowed_fields }}
                </select>
            </div>
        </div>
        <div class="tracker-report-search">
            <button type="submit" name="tracker_expert_query_submit" class="btn btn-primary">
                <i class="icon-search"></i> {{ btn_search }}
            </button>
        </div>
    </form>
</div>
